<template>
  <rich-text :nodes="detail" v-if="detail"></rich-text>
</template>

<script setup>
import { computed } from 'vue'

const props = defineProps({
  data: String
})

const replaceImgElement = (imgStr) => {
  let result = imgStr.replace(/<img/gi, '<img style="width: 100%; height: auto; display: block; vertical-align:bottom; "')
  // result = `<div style="overflow:hidden;font-size: 0;">${result}</div>`
  result = `<div style="overflow: hidden;">${result}</div>`
  return result
}
const detail = computed(() => {
  return replaceImgElement(props.data)
})
</script>

<style lang="scss" scoped></style>
